package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.AgentUserClientFallBack;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "cs-agent-provider", configuration = CsConfiguration.class, fallback = AgentUserClientFallBack.class)
public interface AgentUserClient {
    @RequestMapping(value = "/getAgentUserByPhone", method = RequestMethod.POST)
    Map<String,Object> getAgentUserByPhone(@RequestParam("phone")  String phone);
    @RequestMapping(value = "/createAgentToken", method = RequestMethod.POST)
    String createAgentToken(@RequestParam("agent")  String agent, @RequestBody Map<String, Object> user);
    @RequestMapping(value = "/saveAgentToken", method = RequestMethod.POST)
    void saveAgentToken(@RequestParam("token") String token,@RequestBody Map<String, Object> user);
    @RequestMapping(value = "/getAgentUserByInviCode", method = RequestMethod.POST)
    Map<String,Object> getAgentUserByInviCode(@RequestParam("parent_invitation_code") String parent_invitation_code);
//    @RequestMapping(value = "/getAearningByBCode", method = RequestMethod.POST)
//    List<Map<String,Object>> getAearningByBCode(@RequestBody Map<String, Object> param);
    @RequestMapping(value = "/getAgentAreasByAgentUserId", method = RequestMethod.POST)
    List<Map<String,Object>> getAgentAreasByAgentUserId(@RequestParam("id")String id);
    @RequestMapping(value = "/checkIdCardNum", method = RequestMethod.POST)
    int checkIdCardNum(@RequestParam("idCard")String idCard);
    @RequestMapping(value = "/updateAgent", method = RequestMethod.POST)
    int updateAgent(@RequestBody Map<String, Object> user);
    @RequestMapping(value = "/getAgentLevelPays", method = RequestMethod.POST)
    List<Map<String,Object>> getAgentLevelPays(@RequestParam("id")String id);
    @RequestMapping(value = "/getSetOrderList", method = RequestMethod.POST)
    List<Map<String,Object>> getSetOrderList(@RequestParam("id")String id);
    @RequestMapping(value = "/getAgentUsersByParentInviCode", method = RequestMethod.POST)
    List<Map<String,Object>> getAgentUsersByParentInviCode(@RequestParam("parent_invitation_code") String parent_invitation_code);
    @RequestMapping(value = "/getLevelBCount", method = RequestMethod.POST)
    Map<String,Object> getLevelBCount(@RequestBody Map<String, Object> map);

    @RequestMapping(value = "/insertAgentInvoice", method = RequestMethod.POST)
    int insertAgentInvoice(@RequestBody Map<String, Object> invoiceMap);
    @RequestMapping(value = "/getAgentPayByOutNum", method = RequestMethod.POST)
    int getAgentPayByOutNum(@RequestParam("outNum") String outNum);
    @RequestMapping(value = "/insertAgentPay", method = RequestMethod.POST)
    int insertAgentPay(@RequestBody Map<String, Object> param);
}
